package uk.ac.ebi.microarray.expressionprofiler.ra.fs;

import javax.resource.ResourceException;

/**
 * <p>File System connection provides transparent access to JavaEE Application Server's file system.
 * <br>Compressed files (GZip, Tar) are accessed in the same way as if were simple directories.</p>
 * <p><b>Obtaining an instance:</b></p>
 * <p>To inject a connection factory instance use the following annotation:</p>
 * <pre>@Resource(
 *      mappedName = FileSystemConnectionFactory.JNDI_NAME,
 *      type = FileSystemConnectionFactory.class,
 *      authenticationType = AuthenticationType.CONTAINER
 * )
 * private FileSystemConnectionFactory fscf;</pre>
 * @author Larionov, Konstantin
 *
 */
public interface FileSystemConnectionFactory {

    /**
     * <p>JNDI Name.</p>
     */
    public static final String JNDI_NAME = "java:/eis/AE_EPAdapterFS";

    /**
     * <p>Allocates instance of <code>FileSystemConnection</code>.</p>
     * @param info Instance of <code>FileSystemConnectionInfo</code> class, which defines connection properties.
     * @return Instance of <code>FileSystemConnection</code>.
     * @throws ResourceException
     * @see uk.ac.ebi.microarray.expressionprofiler.ra.fs.FileSystemConnectionInfo
     */
    public FileSystemConnection getConnection(FileSystemConnectionInfo info) throws ResourceException;
}
